class SimpBarChart {
  constructor() {
    this.option = {
      tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'shadow',
          label: {
            show: true,
          },
        },
      },
      grid: {
        top: '8%',
        left: '3%',
        right: '3%',
        bottom: '1%',
        containLabel: true,
      },
      xAxis: {
        type: 'category',
        data: [],
      },
      yAxis: {
        type: 'value',
      },
      series: [
        {
          data: [],
          type: 'bar',
          itemStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [{
                offset: 0, color: '#FFBE6A', // 0% 处的颜色
              }, {
                offset: 1, color: '#FFE0A3 ', // 100% 处的颜色
              }],
            },
          },
          // label: {
          //   show: true,
          //   position: 'top',
          //   fontWeight: '900',
          //   color: '#00000073',
          //   fontSize: '16',
          // },
        },
      ],
    };
  }

  setData(data) {
    let list1 = data.map(el => el.scorefinal);
    let list2 = data.map(el => el.plate);
    this.option.xAxis.data = list2;
    this.option.series[0].data = list1;
  }
}
export default new SimpBarChart();
